SPB Git forge
38commits 1branches 0releases
338.7 MBsize
maindefault branch
6 h agolast push
HTML 53.9% TypeScript 44.5% JavaScript 0.6% SQL 0.5%
1.0 KB · 27 lines tsx
Raw Blame History
1import { api } from "@/lib/api";2import { fmtInt } from "@/lib/format";3import { SOURCE_KIND_LABEL } from "@/lib/labels";4import { OG_CONTENT_TYPE, OG_SIZE, renderOg } from "@/lib/og-template";56export const alt = "Source — DataCenterIndex";7export const size = OG_SIZE;8export const contentType = OG_CONTENT_TYPE;9export const revalidate = 3600;1011export default async function Image({ params }: { params: Promise<{ id: string }> }) {12  const { id } = await params;13  const r = await api.source(id);14  if (!r.ok) return renderOg({ eyebrow: "Source", title: "Source registry", subtitle: "Every value in the index links back to the page it was observed on." });15  const s = r.data;16  return renderOg({17    eyebrow: "Source",18    title: s.name,19    subtitle: `${s.domain} · ${SOURCE_KIND_LABEL[s.kind]}${s.attribution ? ` · ${s.attribution}` : ""}`,20    stats: [21      { label: "Documents", value: fmtInt(s.documents) },22      { label: "Provenance rows", value: fmtInt(s.provenanceRows) },23      { label: "Facilities", value: fmtInt(s.facilities) },24    ],25  });26}27